BeforeUnloadCallback

public interface BeforeUnloadCallback implements BrowserAsyncCallback<P, R>

This callback is invoked when the web page is about to be unloaded.

Some web pages may override the window.onbeforeunload JavaScript function, so that a confirmation dialog will be shown every time when the user tries to reload a web page or navigate to another web page. You can use this callback to display an appropriate confirmation message dialog to ask the user if they really want to leave or reload the web page. To find out whether the web page is going to be reloaded you can check the isReload method.

Use the stay method to stay on the current web page.

Use the leave method to reload or navigate to another web page.

If the callback throws an exception, the leave method will be invoked.

Inheritors

Types

Link copied to clipboard
public final class Action extends AsyncCallbackAction<R>
A responder for the BeforeFormRepostCallback.
Link copied to clipboard
public interface Params
The parameters of the BeforeUnloadCallback.

Functions

Link copied to clipboard
public abstract void on(P params, R tell)
Invoked when the callback needs a response for the given callback parameters.